package com.design.design.pattern.structural.decorator.v1BadExtention;

public class Test {
    public static void main(String[] args) {

        /*
            如果要加需求要加入2个蛋，3个香肠，那么就要修改类
            这样扩展性很差，会出现类爆炸
         */

        ButterCake butterCake = new ButterCake();
        System.out.println(butterCake.getDesc() + " 价钱： " + butterCake.cost());

        ButterCakeWithEgg butterCakeWithEgg = new ButterCakeWithEgg();
        System.out.println(butterCakeWithEgg.getDesc() + " 价钱： " + butterCakeWithEgg.cost());

        ButterCakeWithEggSausage butterCakeWithEggSausage = new ButterCakeWithEggSausage();
        System.out.println(butterCakeWithEggSausage.getDesc() + " 价钱： " + butterCakeWithEggSausage.cost());


    }
}
